
from astropy import units as u
from astropy.time import Time
from netorchestr.envir.base import ONet
from netorchestr.envir.node.pedestrian import CrowdBase

if __name__ == '__main__':
    net = ONet("Crowd")

    init_time = Time("2021-07-22 00:00:00")
    
    crowd = CrowdBase("Crowd", init_time, 10, [113.51071, 34.755339, 0.0], 10*u.m)
    # 停止人群中每个行人的应用层定时器，仅用于演示行人运动模型轨迹
    for ped in list(crowd.pedestrians.values()):
        ped.appLayer.clocktime.stop()
        net.add_module(ped)

    net.draw_flag = True
    net.draw_time_accuracy = 1*u.s
    net.draw_region = [113.51071-0.0011, 
                       113.51071+0.0011, 
                       34.755339-0.0011, 
                       34.755339+0.0011]
    net.run(until=1 * u.min)
